home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form Form1
- Caption = "Events - initializtion & painting"
- ClientHeight = 3765
- ClientLeft = 1020
- ClientTop = 1590
- ClientWidth = 4035
- Height = 4170
- Left = 960
- LinkTopic = "Form1"
- ScaleHeight = 3765
- ScaleWidth = 4035
- Top = 1245
- Width = 4155
- Begin PictureBox Picture1
- Height = 2655
- Left = 300
- ScaleHeight = 2625
- ScaleWidth = 2685
- TabIndex = 0
- Top = 480
- Width = 2715
- End
- Option Explicit
- ' This function adjusts the positions of screen elements
- ' for this form
- Sub AdjustPositions ()
- ' Set the picture control flush with the left side,
- ' keep the current width, but fill the height of the form
- picture1.Move 0, 0, picture1.Width, ScaleHeight
- ' Be sure the picture is large enough
- If ScaleWidth < 3600 Then
- Move left, top, 3700, Height
- Exit Sub
- End If
- End Sub
- Sub Form_Resize ()
- ' 1: Every form gets a resize event when it is
- ' created.
- ' It also gets this event when the form is
- ' resized by the user
- AdjustPositions
- End Sub
- Sub Picture1_Paint ()
- ' 2 - The Paint event occurs when any part of the window
- ' needs to be updated.
- picture1.Line (0, 0)-(picture1.ScaleWidth, picture1.ScaleHeight)
- End Sub
- Sub Picture1_Resize ()
- ' 3 - In this case we also need to force an update
- ' any time the size of the picture changes.
- picture1.Refresh
- End Sub
-